package awt.awt02;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class Dialog_00 {
    public static void main(String[] args){
        Frame fr=new Frame("Dialog_00");

        Dialog d1=new Dialog(fr,"模式对话框",true);
        Dialog d2=new Dialog(fr,"非模式对话框",false);


        d1.setBounds(100,100,300,300);
        d2.setBounds(100,100,300,300);

        Button b1=new Button("打开模式对话框");
        Button b2=new Button("打开非模式对话框");

        b1.addActionListener(new ActionListener(){
            @Override
            public void actionPerformed(ActionEvent e){
                d1.setVisible(true);
            }
        });


        b2.addActionListener(new ActionListener(){
            @Override
            public void actionPerformed(ActionEvent e){
                d2.setVisible(true);
            }
        });


        fr.add(b1,BorderLayout.NORTH);
        fr.add(b2);


        fr.pack();
        fr.setVisible(true);
    }
}
